
//
//  HTBaseViewController.swift
//  mySinaBlog
//
//  Created by whtapple on 3/23/16.
//  Copyright © 2016 whtapple. All rights reserved.
//

import UIKit

class HTBaseViewController: UITableViewController{

   //设置是否登陆属性
    var userLogin = HTUserAccountViewModel.sharedInstance.isLogin()
    //加载 View
    override func loadView() {
        
        userLogin ? super.loadView() : setupVisitorView()
    }
    //设置 setup
     func setupVisitorView() {
         view = visitorView
        visitorView.delegate = self
        if(self is HTHomeTableViewController){
            visitorView.rotate()
            
        }else if(self is HTDiscoverTableViewController){
          visitorView.setupVisitorView("visitordiscover_image_message", message: "登录后，别人评论你的微博，发给你的消息，都会在这里收到通知")
        }else if(self is HTMessageTableViewController){
            visitorView.setupVisitorView("visitordiscover_image_message", message: "登录后，别人评论你的微博，发给你的消息，都会在这里收到通知")
        }else if(self is HTProfileTableViewController){
            visitorView.setupVisitorView("visitordiscover_image_profile", message: "登录后，你的微博、相册、个人资料会显示在这里，展示给别人")
        }
    }
    lazy var visitorView: HTVistorView = HTVistorView()
}
//MARK: - 代理方法
extension HTBaseViewController:HTVistorViewDelegate{
    func clickLoginButton() {
        let oauthController = HTOauthViewController()
        presentViewController(UINavigationController(rootViewController: oauthController), animated: true) { () -> Void in
            print("点击了登陆按钮")
        }
    }
    func clickRegisterButton() {
       print(__FUNCTION__)
    }
}
